package com.liu.manager.mapper;

import com.liu.manager.entity.Sysuser;
import org.apache.ibatis.annotations.*;

@Mapper
public interface SysuserMapper {

    @Insert("insert into sysuser(name,password,create_time,update_time,status) values(#{name},#{password},#{createTime},#{updateTime},#{status})")
    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    int insertUser(Sysuser sysuser);

    @Delete("delete from sysuser where id = #{id}")
    int deleteUser(long id);

    @Update("update sysuser set name=#{name},password=#{password},update_time=#{updateTime}")
    int updateUser(Sysuser sysuser);

    @Select("select * from sysuser where id=#{id}")
    Sysuser getUserByid(long id);

    @Select("select * from sysuser where name=#{name}")
    Sysuser getUserByName(String name);
}
